﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Tasks.Common.Entitys;
using Tasks.Common;
using MyLib.Util;
using Tasks.Common.Enum;
using Tasks.Business;
using System.IO;

namespace Tasks.Core
{
    /// <summary>
    /// 页面辅助类
    /// </summary>
    public class PageHelper
    {
        #region "数据格式转换"

        /// <summary>
        /// 导游工作级别
        /// </summary>
        /// <param name="WorkLevel"></param>
        /// <returns></returns>
        public static string WorkLevelToStr(int WorkLevel)
        {
            return CommonUtil.GetEnumDescription(typeof(TourGuideLevel), WorkLevel);
        }

        /// <summary>
        /// 任务状态
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList TaskTypeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add((int)ArticleType.Bug, "BUG");
            dicts.Add((int)ArticleType.Task, "任务");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 任务状态
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList StateSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "状态");
            dicts.Add(1, "未分配");
            dicts.Add(2, "已分配");
            dicts.Add(3, "已解决");
            dicts.Add(4, "已关闭");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 工作性质
        /// </summary>
        /// <param name="WorkTime"></param>
        /// <returns></returns>
        public static string WorkTimeToStr(int WorkTime)
        {
            return CommonUtil.GetEnumDescription(typeof(TourGuideWorkTime), WorkTime);
        }
     
        /// <summary>
        /// 转换支付状态中文
        /// </summary>
        /// <param name="paymentState"></param>
        /// <returns></returns>
        public static string PaymentStateToStr(int paymentState)
        {
            return CommonUtil.GetEnumDescription(typeof(PaymentState), paymentState);
        }

        /// <summary>
        /// 项目类型
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList ProjectType(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "项目类型");
            dicts.Add(1, "ERP系统  erp.ziuuu.cn");
            dicts.Add(2, "eTicket系统  eticket.ziuuu.cn");
            dicts.Add(3, "盛途交易网  www.cttw.cn");
            dicts.Add(4, "旅游超市（B2C）web.ziuuu.cn");
            dicts.Add(5, "公司其他事项");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
     

        /// <summary>
        /// 转换支付状态中文
        /// </summary>
        /// <param name="paymentState"></param>
        /// <returns></returns>
        public static string PaymentModeToStr(int paymentMode)
        {
            return CommonUtil.GetEnumDescription(typeof(PaymentMode), paymentMode);
        }



        /// <summary>
        /// 企业用户状态转换为字符串
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string EnterpriseStateToStr(int enterpriseState)
        {
            return CommonUtil.GetEnumDescription(typeof(EnterpriseMemberState), enterpriseState);
        }
        /// <summary>
        /// 门票状态转换为字符串
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string SceneryStateToStr(int sceneryState)
        {
            return CommonUtil.GetEnumDescription(typeof(SceneryState), sceneryState);
        }

        /// <summary>
        /// 门票状态转换为字符串
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string SceneryTicketStateToStr(int ticketState)
        {
            return CommonUtil.GetEnumDescription(typeof(SceneryTicketState), ticketState);
        }



        /// <summary>
        /// 线路状态转换为字符串
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string TourStateToStr(int tourState)
        {
            return CommonUtil.GetEnumDescription(typeof(TourState), tourState);
        }

        /// <summary>
        /// 线路订单状态转换为字符
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string TourChangingOrderStateToStr(int state)
        {
            return CommonUtil.GetEnumDescription(typeof(TourChangingOrderState), state);
        }

        /// <summary>
        /// 景点门票订单状态转换为字符
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string SceneryTicketOrderStateToStr(int orderState)
        {
            return CommonUtil.GetEnumDescription(typeof(SceneryTicketOrderState), orderState);
        }

        /// <summary>
        /// 线路订单状态转换为字符
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string TourOrderStateToStr(int orderState)
        {
            return CommonUtil.GetEnumDescription(typeof(TourOrderState), orderState);
        }
        /// <summary>
        /// 酒店星级转换为字符
        /// </summary>
        /// <param name="tourState"></param>
        /// <returns></returns>
        public static string HotelLevelToStr(int Level)
        {
            return CommonUtil.GetEnumDescription(typeof(HotelLevel), Level);
        }
        /// <summary>
        /// 团队标准换为字符
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public static string TeamLevelToStr(int level)
        {
            switch (level)
            {
                case 1:
                    return "准二";
                case 2:
                    return "挂二";
                case 3:
                    return "准三";
                case 4:
                    return "挂三";
                case 5:
                    return "准四";
                case 6:
                    return "挂四";
                case 7:
                    return "准五";
                case 8:
                    return "挂五";
            }
            return "";
        }
        /// <summary>
        /// 预控车型转换为字符
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public static string PlanCarTypeToStr(int carType)
        {
            switch (carType)
            {
                case 0:
                    return "待定";
                case 1:
                    return "5座";
                case 2:
                    return "7座";
                case 3:
                    return "9座";
                case 4:
                    return "11座";
                case 5:
                    return "12座";
                case 6:
                    return "13座";
                case 7:
                    return "14座";
                case 8:
                    return "15座";
                case 9:
                    return "16座";
                case 10:
                    return "18座";
                case 11:
                    return "19座";
                case 12:
                    return "22座";
                case 13:
                    return "25座";
                case 14:
                    return "33座";
                case 15:
                    return "37座";
                case 16:
                    return "45座";
                case 17:
                    return "49座";
                case 18:
                    return "53座";
                case 19:
                    return "57座";
            }
            return "";
        }
        /// <summary>
        /// 线路行程规则转换为字符串
        /// </summary>
        /// <param name="rule"></param>
        /// <returns></returns>
        public static string TourTravelDateRuleToStr(string rule)
        {
            if (string.IsNullOrEmpty(rule)) return "";

            string[] rules = rule.Split('|');
            string str = "";
            switch (rules[0])
            {
                case "0":
                    foreach (string s in rules[1].Split(','))
                    {
                        if (s == "6")
                            str += "日\\";
                        else
                            str += "周" + StringUtil.GetNumberChar(int.Parse(s) + 1) + "\\";
                    }
                    if (str != "")
                        str = str.TrimEnd('\\');

                    return str;
                case "1":
                    foreach (string s in rules[1].Split(','))
                    {
                        if (!string.IsNullOrEmpty(s))
                            str += DateTime.Parse(s).ToString("MM/dd") + "|";
                    }
                    if (str != "")
                        str = str.TrimEnd('|');

                    return "(" + str + ")";
                case "2":
                    return "间隔" + rules[1] + "天";
            }
            return "";
        }

        /// <summary>
        /// 团队计划类型转换为字符
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string TourTeamPlanTypeToStr(int type)
        {
            return CommonUtil.GetEnumDescription(typeof(TourTeamPlanType), type);
        }

        /// <summary>
        /// 团款支付方式转换为中文
        /// </summary>
        /// <param name="payMode"></param>
        /// <returns></returns>
        public static string TourTeamPayModeToStr(int payMode)
        {
            return CommonUtil.GetEnumDescription(typeof(TourTeamPayMode), payMode);
        }
        #endregion

        #region "下拉框数据"


        /// <summary>
        /// 会员类别
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList Per_Member_Cat(int defaultValue)
        {
            IList<DictValue> cats = BusinessFactory.BasedataBLL.Per_Member_Cat();
            cats.Insert(0, new DictValue() { ID = 0 });

            return new SelectList(cats, "ID", "Name", defaultValue);
        }
       

        /// <summary>
        /// 部门 selectlist
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList DeptSelector(int defaultValue)
        {
            IList<DictValue> dicts = BusinessFactory.BasedataBLL.GetDepartments();
            dicts.Insert(0, new DictValue() { ID = 0 });
            return new SelectList(dicts, "ID", "Name", defaultValue);
        }

        /// <summary>
        /// 员工性别
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList SexSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "男");
            dicts.Add(1, "女");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 酒店支付方式
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList HotelPaymentSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "现金");
            dicts.Add(2, "前台支付");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 景点游玩主题
        /// </summary>
        /// <returns></returns>
        public static SelectList SceneryPlaythemeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "海岛乐园");
            dicts.Add(2, "动物世界");
            dicts.Add(3, "温泉水世界");
            dicts.Add(4, "人文景观");
            dicts.Add(5, "嬉水漂流");
            dicts.Add(6, "古迹园林");
            dicts.Add(7, "生态山水");
            dicts.Add(8, "乐园场馆");
            dicts.Add(9, "文化宗教");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 客户类型  直客、同行
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList ClientTypeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "直客");
            dicts.Add(2, "同行");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 公司分组
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList CategoryTypeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "办事处");
            dicts.Add(2, "组团社");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 预订酒店确认方式
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList HotelConfirmModeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add((int)HotelConfirmMode.不用确定, "不用确定");
            dicts.Add((int)HotelConfirmMode.电话确认, "电话确认");
            dicts.Add((int)HotelConfirmMode.EMAIL确定, "EMAIL确定");
            dicts.Add((int)HotelConfirmMode.FAX确认, "FAX确认");
            dicts.Add((int)HotelConfirmMode.短信确认, "短信确认");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 预订酒店确认方式
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static string HotelConfirmModeToStr(int value)
        {
            if (value == 0) return "";
            return HotelConfirmModeSelector(value).First(t => t.Selected == true).Text;
        }

        /// <summary>
        /// 门票支付方式
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static IList<SelectListItem> SceneryPaymentSelector(string[] selectedValues)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add((int)PaymentMode.在线支付, "在线支付");
            dicts.Add((int)PaymentMode.到付, "景区现付");
            dicts.Add((int)PaymentMode.信用额度, "签单结算");
            //dicts.Add((int)PaymentMode.POS机刷卡支付, "POS机刷卡支付");
            var selectListItems = from i in dicts
                                  select new SelectListItem
                                  {
                                      Text = i.Value,
                                      Value = i.Key.ToString(),
                                      Selected = (selectedValues != null && selectedValues.Contains(i.Key.ToString()))
                                  };

            return selectListItems.ToList();
        }

        /// <summary>
        /// 企业会员支付方式
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList EpMemberPaymentSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "签单");
            dicts.Add(1, "现金");
            dicts.Add(2, "月结");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }


        /// <summary>
        /// 数字下拉框
        /// </summary>
        /// <param name="min">最小值</param>
        /// <param name="max">最大值</param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList NumberSelector(int min, int max, int defaultValue)
        {
            IDictionary<int, int> dicts = new Dictionary<int, int>();

            for (int i = min; i <= max; i++)
            {

                dicts.Add(i, i);
            }

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 酒店级别
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList HotelLevelSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "一星");
            dicts.Add(2, "二星");
            dicts.Add(3, "三星");
            dicts.Add(4, "四星");
            dicts.Add(5, "五星");
            dicts.Add(6, "准一星");
            dicts.Add(7, "准二星");
            dicts.Add(8, "准三星");
            dicts.Add(9, "准四星");
            dicts.Add(10, "准五星");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 酒店主题
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList HotelHotelPlaythemeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "");
            dicts.Add(1, "精品酒店");
            dicts.Add(2, "度假酒店");
            dicts.Add(3, "主题酒店");
            dicts.Add(4, "品牌酒店");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        #region 导游相关
        /// <summary>
        /// 导游级别
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList WorkLevelSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "导游等级");
            dicts.Add((int)TourGuideLevel.初级, "初级");
            dicts.Add((int)TourGuideLevel.中级, "中级");
            dicts.Add((int)TourGuideLevel.高级, "高级");
            dicts.Add((int)TourGuideLevel.特级, "特级");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 导游工作性质
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList WorkTimeSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "工作类型");
            dicts.Add((int)TourGuideWorkTime.专职, "专职");
            dicts.Add((int)TourGuideWorkTime.兼职, "兼职");
            dicts.Add((int)TourGuideWorkTime.临时, "临时");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 工作评价
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList WorkAppraiseSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "工作评价");
            dicts.Add((int)TourGuideWorkAppraise.优秀, "优秀");
            dicts.Add((int)TourGuideWorkAppraise.良好, "良好");
            dicts.Add((int)TourGuideWorkAppraise.一般, "一般");
            dicts.Add((int)TourGuideWorkAppraise.较差, "较差");
            dicts.Add((int)TourGuideWorkAppraise.极差, "极差");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        public static IList<SelectListItem> GuideWorkItem()
        {
            List<SelectListItem> items = new List<SelectListItem>();
            items.Add(new SelectListItem { Text = "导游", Value = "1" });
            items.Add(new SelectListItem { Text = "全陪", Value = "2" });
            items.Add(new SelectListItem { Text = "领队", Value = "3" });
            return items;
        }
        /// 性别
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList GuideSexSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(2, "性别");
            dicts.Add(0, "男");
            dicts.Add(1, "女");

            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        /// <summary>
        /// 状态
        /// </summary>
        /// <returns></returns>
        public static SelectList GuideStateSelector()
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add((int)TourGuideState.有效, "正常");
            dicts.Add((int)TourGuideState.无效, "停止");
            return new SelectList(dicts, "Key", "Value");
        }
        /// <summary>
        /// 语言
        /// </summary>
        /// <returns></returns>
        public static SelectList GuideLanguage()
        {
            IList<DictValue> dicts = BusinessFactory.BasedataBLL.GetGuidLanguage();
            dicts.Insert(0, new DictValue() { ID = 0, Name = "语言" });
            return new SelectList(dicts, "ID", "Name");
        }
        /// <summary>
        /// 购物点类别
        /// </summary>
        /// <returns></returns>
        public static SelectList ShopTypeSelector()
        {
            IList<DictValue> dicts = BusinessFactory.BasedataBLL.GetShopType();
            dicts.Insert(0, new DictValue() { ID = 0 });
            return new SelectList(dicts, "ID", "Name");
        }

        /// <summary>
        /// 地接费用类别
        /// </summary>
        /// <returns></returns>
        public static SelectList GetTeamPlanCharges()
        {
            IList<DictValue> dicts = BusinessFactory.BasedataBLL.GetTeamPlanCharges();
            //dicts.Insert(0, new DictValue() { ID = 0, Name = "" });
            return new SelectList(dicts, "ID", "Name");
        }

        /// <summary>
        /// 工作类别
        /// </summary>
        /// <returns></returns>
        public static SelectList GuideWorkTypeSelector()
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "工作性质");
            dicts.Add(1, "导游");
            dicts.Add(2, "全陪");
            dicts.Add(3, "领队");
            return new SelectList(dicts, "Key", "Value");
        }
        #endregion
        /// <summary>
        /// 单位性质 
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList RelationSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(1, "一般单位");
            dicts.Add(2, " 协议单位");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }
        #endregion

        /// <summary>
        /// 删除图片
        /// </summary>
        /// <param name="photoID"></param>
        public static void DeletePhoto(int photoID)
        {
            BasedataBLL baseBLL = BusinessFactory.BasedataBLL;
            Photo p = baseBLL.GetPhoto(photoID);

            //删除图片文件
            string path = Config.UploadPath;
            System.IO.File.Delete(path + p.Path);
            //删除缩略图
            for (int i = 0; i < 10; i++)
            {
                System.IO.File.Delete(path + Path.GetFileNameWithoutExtension(p.Path) + "_" + i + Path.GetExtension(p.Path));
            }

            baseBLL.DeletePhoto(photoID);
        }

        /// <summary>
        /// 时间--分钟选择
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList TimeMinuteSelector(string defaultValue)
        {
            IDictionary<string, string> dicts = new Dictionary<string, string>();
            dicts.Add("00", "00");
            dicts.Add("30", "30");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 加点费用分类
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList AddPointSelector(int defaultValue)
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(0, "自带团");
            dicts.Add(1, "自备车");
            dicts.Add(2, "特殊团");
            return new SelectList(dicts, "Key", "Value", defaultValue);
        }

        /// <summary>
        /// 加点费用分类
        /// </summary>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static SelectList ArticlePermissionsSelector()
        {
            IDictionary<int, string> dicts = new Dictionary<int, string>();
            dicts.Add(1, "总经理");
            dicts.Add(2, "地接主管、计调经理、财务经理");
            dicts.Add(3, "所有人");
            return new SelectList(dicts, "Key", "Value");
        }

        /// <summary>
        /// 酒店星级样式
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public static string HotelLevelImg(int level)
        {
            switch (level)
            {
                case (int)HotelLevel.一星:
                    return "hotel_stars01";
                case (int)HotelLevel.二星:
                    return "hotel_stars02";
                case (int)HotelLevel.三星:
                    return "hotel_stars03";
                case (int)HotelLevel.四星:
                    return "hotel_stars04";
                case (int)HotelLevel.五星:
                    return "hotel_stars05";
            }
            return "";
        }
        /// <summary>
        /// 获取员工联系方式 (打印模块使用)
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static string GetLinkManInfo(int userID)
        {
            string info = "";
            Employee employee = BusinessFactory.Account.GetEmployee(userID);
            if (employee != null)
            {
                info = employee.Name == null ? "" : employee.Name;
                info += employee.Contact.Tel == null ? "" : " Tel:<b>" + employee.Contact.Tel + "</b>";
                info += employee.Contact.Fax == null ? "" : " Fax:<b>" + employee.Contact.Fax + "</b>";
                info += employee.MobileNo == null ? "" : " Mb:<b>" + employee.MobileNo + "</b>";
            }
            return info;

        }
        /// <summary>
        /// 支付方式转为字符
        /// </summary>
        /// <param name="paymendMode"></param>
        /// <returns></returns>
        public static string GetPaymentModeStrForTourTeamPlan(int paymendMode)
        {
            string str = "";
            switch (paymendMode)
            {
                case (int)TourTeamPayMode.现付:
                    str = " <sup> <font color='red' title='导游现付'>现</font></sup>";
                    return str;
                case (int)TourTeamPayMode.签单:
                    str = " <sup> <font color='green' title='签单挂账'>签</font></sup>";
                    return str;
                case (int)TourTeamPayMode.财务付款:
                    str = " <sup> <font color='blue' title='财务付款'>汇</font></sup>";
                    return str;
            }
            return str;
        }

        /// <summary>
        /// 线路类型转为字符
        /// </summary>
        /// <param name="paymendMode"></param>
        /// <returns></returns>
        public static string GetTourTeamPlanTypeStrForTourTeamPlan(int tourTeamPlanType)
        {
            string str = "";
            switch (tourTeamPlanType)
            {
                case (int)TourTeamPlanType.代订房:
                    str = "<div style='background-color: Yellow; color: Blue;'>房</div>";
                    return str;
                case (int)TourTeamPlanType.代订车:
                    str = "<div style='background-color: Yellow; color: Blue;'>车</div>";
                    return str;
                case (int)TourTeamPlanType.代订票:
                    str = "<div style='background-color: Yellow; color: Blue;'>票</div>";
                    return str;
            }
            return str;
        }

        /// <summary>
        /// 星期转换
        /// </summary>
        /// <param name="week"></param>
        /// <returns></returns>
        public static string GetWeekChar(string week)
        {
            switch (week)
            {
                case "Monday":
                    return "[一]";
                case "Tuesday":
                    return "[二]";
                case "Wednesday":
                    return "[三]";
                case "Thursday":
                    return "[四]";
                case "Friday":
                    return "[五]";
                case "Saturday":
                    return "[六]";
                case "Sunday":
                    return "[日]";
            }
            return "";
        }
        public static string GetPostion(int provinceID, int cityID, int areaID)
        {
            return new BasedataBLL(Config.CompanyID).GetPostion(provinceID, cityID, areaID);
        }
    }
}
